import { Optional } from "@nestjs/common";
import { ApiProperty } from "@nestjs/swagger";
import { IsBoolean, IsNumber, IsString, ValidateNested } from "class-validator";
import { Photo } from "libs/db/entity/photo.entity";

export class CreatePhotoMetadataDto {
  @ApiProperty({
    example: 1,
    description: '主键',
    required: false
  })
  @IsNumber()
  @Optional()
  id?: number;

  @ApiProperty({
    example: 12,
    description: '高度 单位 px',
    required: false
  })
  @IsNumber()
  @Optional()
  height?: number;

  @ApiProperty({
    example: 11,
    description: '宽度 ',
    required: false
  })
  @IsNumber()
  @Optional()
  width?: number;

  @ApiProperty({
    example: 'hahha',
    description: '来源 ',
    required: false
  })
  @IsString()
  @Optional()
  orientation?: string;

  @ApiProperty({
    example: true,
    description: '比较起来 ',
    required: false
  })
  @IsBoolean()
  @Optional()
  compressed?: boolean;

  @ApiProperty({
    example: '很好很好',
    description: '评论',
    required: false
  })
  @IsString()
  @Optional()
  comment?: string;

  @ValidateNested()
  @IsNumber()
  photo?: Photo;
}